package com.yhm.myfootbollshow.demos.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yhm.myfootbollshow.demos.base.ResVo;
import com.yhm.myfootbollshow.demos.entity.dto.PageBase;
import com.yhm.myfootbollshow.demos.entity.po.Merchant;
import com.yhm.myfootbollshow.demos.service.MerchantService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @description:
 * @author: yhm
 * @time: 2025/4/13 12:21
 */
@RestController
@RequestMapping("/yhm/merchant")
public class MerchantController {

    @Resource
    private MerchantService merchantService;

    @PostMapping("/addmerchan")
    public ResVo<Boolean> addMerchan(Merchant merchant){
        return ResVo.ok(merchantService.addMerchan(merchant));
    }

    @GetMapping("/list")
    public ResVo<IPage<Merchant>> list(PageBase page){
        return ResVo.ok(merchantService.list(page));
    }

    @PostMapping("/banMerchant")
    public ResVo<Boolean> banMerchant(Long merchantId,String username,Integer status){
        return ResVo.ok(merchantService.banMerchant(merchantId, username, status));
    }
}
